package com.chiyoyo.multipay.framework.core.client.exception;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * @author chil
 *  支付系统异常 Exception
 */
@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class PayException extends RuntimeException {
    /**
     * 业务错误码
     */
    private Integer code;
    /**
     * 错误提示
     */
    private String message;

    public PayException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public PayException(String message) {
        this.code = 400;
        this.message = message;
    }

    public PayException(Throwable cause) {
        super(cause);
    }
}
